
%% Init
clc;close;clear
addpath("./M_Function/")
hold all
s = tf('s')
%% PID
kp = 1;
wi = 10; Ti = 1/wi; % 积分环节转折频率
wd = 1000; Td = 1/wd; % 微分环节转折频率


PI_Loop = kp*(1 + 1/(Ti*s));
PD_Loop = kp*(1 + Td*s);
PID_Loop = kp*(1 + Ti*s + Td*s);
figure(2)
bode(PI_Loop)
bode(PD_Loop)
bode(PID_Loop)
legend("PI Loop","PD Loop","PID Loop")